<?php
/**
 * Created by Pako
 * Date: 2018/8/19
 * Time: 10:13
 */

namespace App\Models\Auth;


use Illuminate\Database\Eloquent\Model;

class Role extends Model
{
    protected $table = 'auth_role';
    protected $primaryKey = 'role_id';
    protected $fillable = ['name', 'status', 'key_name'];


    public function permissions()
    {
        return $this->belongsToMany('App\Models\Auth\Permission',
            'auth_role_permission',
            'role_id',
            'permission_id'
        );
    }
}